﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Pyramid.Models
{
	public class StaffAchievementGatherMaster
	{
		public int Id { get; set; }
		public int Year { get; set; }
		public int Month { get; set; }
		public DateTime CreateTime { get; set; }

		[Required]
		[MaxLength(20)]
		public string CreateUserId { get; set; }

		public int Status { get; set; }

		[NotMapped]
		public FinanceStatus StatusEnum
		{
			get { return (FinanceStatus) Status; }
		}

		public virtual ICollection<StaffAchievementGatherDetail> Details { get; set; }
	}

	public class StaffAchievementGatherDetailDto
	{
		public int Id { get; set; }
		public int MasterId { get; set; }
		public int StaffId { get; set; }
		public decimal TotalAmount { get; set; }
	}

	/// <summary>
	/// 员工业绩统计
	/// </summary>
	public class StaffAchievementGatherDetail : StaffAchievementGatherDetailDto
	{
		[ForeignKey("StaffId")]
		public virtual Staff Staff { get; set; }

		[ForeignKey("MasterId")]
		public virtual StaffAchievementGatherMaster Master { get; set; }
	}
}